package io.gitee.loulan_yxq.owner.mybatisPlus.test.config.injector;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.metadata.TableInfo;

import java.util.List;

/*********************************************************
 ** 配置sql注入器
 ** <br><br>
 ** Date: Created in 2022/6/24 14:15
 ** @author loulan
 ** @version 0.0.0
 *********************************************************/
public class MyLogicSqlInjector extends DefaultSqlInjector {

    /**
     * 如果只需增加方法，保留MP自带方法
     * 可以super.getMethodList() 再add
     * @return
     */
    @Override
    public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
        List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo);
        methodList.add(new MySelect());
        //methodList.add(new SelectById());
        return methodList;
    }
}
